package com.yuandian.management.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuandian.api.management.entity.ConfAgentIp;
import com.yuandian.management.mapper.ConfAgentIpMapper;
import com.yuandian.management.service.ConfAgentIpService;
import com.yuandian.management.vo.AgentIpPojo;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 迁移至 BPM3.0
 * agentip管理表-Service实现
 * @author zfsn
 * @date 2023-4-14
 */
@Service
@RequiredArgsConstructor
public class ConfAgentIpServiceImpl extends ServiceImpl<ConfAgentIpMapper, ConfAgentIp>
		implements ConfAgentIpService {

	private final ConfAgentIpMapper confAgentIpMapper;

	/**
	 * 根据ip更新AgentIp
	 *
	 * @param agentIp
	 * @return
	 */
	@Override
	public int updateByIpSelective(AgentIpPojo agentIp) {
		return confAgentIpMapper.updateByIpSelective(agentIp);
	}

	/**
	 * 插入AgentIp
	 *
	 * @param agentIp
	 */
	@Override
	public void insertAgentIp(AgentIpPojo agentIp) {
		confAgentIpMapper.insertAgentIp(agentIp);
	}

	@Override
	public int countNormalAgentIp() {
		return confAgentIpMapper.countNormalAgentIp();
	}

	/**
	 * 根据条件查询
	 *
	 * @param searchKey
	 * @return
	 */
	@Override
	public List<ConfAgentIp> queryList(String searchKey) {
		return confAgentIpMapper.queryList(searchKey);
	}
}
